package com.jordge.paper;

/**
 * Created by IntelliJ IDEA.
 * User: Winstars
 * Date: 2007-3-27
 * Time: 17:37:05
 */
public class NativeInvocation {
    //Self holding
    private static NativeInvocation ni;

    static {
        System.loadLibrary("nativecode");
        NativeInvocation.ni = new NativeInvocation();
    }

    //Native method from windows
    private static native int compileTarget(String sourceFile, String sourceType, String logFile);

    private static native int RunTarget(String exeFile, String testInFile, String testOutFile, String logFile, int cpuLimit, int memLimit);
	
	//Wrapped Method of windows
    public static int compile(String sourceFile, String sourceType, String logFile){
        return compileTarget(sourceFile,sourceType,logFile);
    }

    public static int run(String exeFile, String testInFile, String testOutFile, String logFile, int cpuLimit, int memLimit){
        return RunTarget(exeFile,testInFile,testOutFile,logFile,cpuLimit,memLimit);
    }
}
